package com.longxiao.vo;

/**
 * Created by yusong on 2017/5/14.
 * 更新教师请求
 */
public class UpdateTchVo extends UpdateUserVo {

    private String password;

    // 验证必要参数是否有值
    public boolean isEmpty() {

        if (!isEmpty(super.getEmail())) {
            return Boolean.TRUE;
        }
        if (!isEmpty(super.getCity())) {
            return Boolean.TRUE;
        }
        if (!isEmpty(super.getOccupation())) {
            return Boolean.TRUE;
        }
        if (!isEmpty(password)) {
            return Boolean.TRUE;
        }
        return Boolean.FALSE;
    }

    private boolean isEmpty(Object val) {
        if (val == null)
            return Boolean.TRUE;
        if (val instanceof String) {
            if ("".equals(val)) {
                return Boolean.TRUE;
            }
        }
        return Boolean.FALSE;
    }


    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
